/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #1e3c72 100%);
    color: #fff;
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    max-width: 100vw;
    margin: 0 auto;
    padding: 0 10px;
}

.header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 10px 30px;
    margin: 10px 0;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.title-section {
    flex: 1;
}

.status-section {
    flex-shrink: 0;
}

.main-title {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 5px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.sub-title {
    font-size: 1rem;
    opacity: 0.8;
    margin-bottom: 0;
    font-style: italic;
}

.status-bar {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 0.85rem;
    opacity: 0.8;
    text-align: right;
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 0 5px;
    width: 100%;
    box-sizing: border-box;
}

.machine-status-section {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 100%;
    box-sizing: border-box;
}

.section-title {
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 25px;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* 机器网格布局 */
.machine-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

/* 确保最后一行只有5个卡片，并且所有卡片宽度一致 */
.machine-grid::after {
    content: '';
    grid-column: 6;
    grid-row: 5;
}



/* 机器卡片样式 */
.machine-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 0;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
    overflow: hidden;
    min-height: 125px;
    display: flex;
    flex-direction: column;
    width: 100%;
    box-sizing: border-box;
}

.machine-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
}

/* 特殊机器卡片样式 */
.machine-card[data-machine-number="1"],
.machine-card[data-machine-number="2"],
.machine-card[data-machine-number="15"],
.machine-card[data-machine-number="16"],
.machine-card[data-machine-number="17"],
.machine-card[data-machine-number="18"],
.machine-card[data-machine-number="19"],
.machine-card[data-machine-number="20"],
.machine-card[data-machine-number="21"],
.machine-card[data-machine-number="22"],
.machine-card[data-machine-number="23"],
.machine-card[data-machine-number="24"],
.machine-card[data-machine-number="25"] {
    background: rgba(255, 165, 0, 0.2);
    border-color: rgba(255, 165, 0, 0.4);
}

.machine-card[data-machine-number="1"] .machine-header,
.machine-card[data-machine-number="2"] .machine-header,
.machine-card[data-machine-number="15"] .machine-header,
.machine-card[data-machine-number="16"] .machine-header,
.machine-card[data-machine-number="17"] .machine-header,
.machine-card[data-machine-number="18"] .machine-header,
.machine-card[data-machine-number="21"] .machine-header,
.machine-card[data-machine-number="22"] .machine-header,
.machine-card[data-machine-number="23"] .machine-header,
.machine-card[data-machine-number="24"] .machine-header {
    background: linear-gradient(135deg, #ff8c00 0%, #ff6b35 100%);
}

.machine-card:not([data-machine-number="1"]):not([data-machine-number="2"]):not([data-machine-number="15"]):not([data-machine-number="16"]):not([data-machine-number="17"]):not([data-machine-number="18"]):not([data-machine-number="21"]):not([data-machine-number="22"]):not([data-machine-number="23"]):not([data-machine-number="24"]) {
    background: rgba(34, 139, 34, 0.2);
    border-color: rgba(34, 139, 34, 0.4);
}

.machine-card:not([data-machine-number="1"]):not([data-machine-number="2"]):not([data-machine-number="15"]):not([data-machine-number="16"]):not([data-machine-number="17"]):not([data-machine-number="18"]):not([data-machine-number="21"]):not([data-machine-number="22"]):not([data-machine-number="23"]):not([data-machine-number="24"]) .machine-header {
    background: linear-gradient(135deg, #228b22 0%, #32cd32 100%);
}

/* 机器头部样式 */
.machine-header {
    background: #4CAF50;
    color: white;
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    font-size: 1rem;
}

.machine-model {
    font-size: 1.1rem;
    font-weight: bold;
}

.machine-number {
    font-size: 1.1rem;
    font-weight: bold;
}

/* 机器内容样式 */
.machine-content {
    display: flex;
    flex: 1;
    padding: 6px;
    flex-direction: column;
    gap: 4px;
}

.content-row {
    display: flex;
    justify-content: space-between;
    gap: 6px;
}

.content-row:last-child {
    margin-top: 2px;
}

.info-item {
    display: flex;
    align-items: center;
    font-size: 0.7rem;
    flex: 1;
    gap: 2px;
}

.info-label {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

.info-value {
    color: #fff;
    font-weight: bold;
}

.info-value.empty {
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
}

.info-remaining {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.75rem;
    margin-left: 4px;
}

.info-unit {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.7rem;
    margin-left: 2px;
}

/* 剩余时间样式 - 让标签和值更靠近 */
.info-item .info-label:contains("剩余") {
    margin-right: 2px;
}

.info-item .info-value {
    margin-left: 2px;
}

/* 机器网格布局 */
.machine-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    margin-bottom: 20px;
    width: 100%;
    box-sizing: border-box;
}

/* 确保最后一行只有5个卡片 */
.machine-grid::after {
    content: '';
    grid-column: 6;
    grid-row: 5;
}

/* 确保所有卡片宽度一致 */
.machine-card {
    width: 100%;
    min-width: 0;
    max-width: none;
}

/* 待翻品种计划区域 */
.pending-plan-section {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 15px;
    backdrop-filter: blur(10px);
    width: 100%;
}

.plan-tables-container {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding: 8px 0;
}

.plan-table-group {
    flex: 1;
    min-width: 160px;
}

.plan-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.plan-table th,
.plan-table td {
    padding: 6px 8px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.plan-table th {
    background: rgba(255, 255, 255, 0.2);
    font-weight: bold;
    color: #fff;
}

.plan-table td {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.plan-table td.empty {
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
}

/* 弹框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: linear-gradient(135deg, #2a5298 0%, #1e3c72 100%);
    margin: 5% auto;
    padding: 0;
    border-radius: 15px;
    width: 80%;
    max-width: 600px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease-out;
}

.modal-content.modal-large {
    max-width: 1600px;
    width: 95%;
    height: 85vh;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.modal-header-left h3 {
    color: #fff;
    font-size: 1.5rem;
    margin: 0;
}

.machine-number-badge {
    background: #007bff;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 1.2rem;
}

.modal-header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.current-speed {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
    font-size: 0.9rem;
}

.current-speed span:first-child {
    opacity: 0.8;
}

.current-speed span:last-child {
    font-size: 1.2rem;
    font-weight: bold;
    color: #ffd700;
}

.close {
    color: rgba(255, 255, 255, 0.7);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #fff;
}

.modal-body {
    padding: 20px;
    height: calc(85vh - 120px);
    overflow: hidden;
}

/* 弹框详细布局 */
.modal-detail-layout {
    display: flex;
    flex-direction: column;
    gap: 15px;
    height: 100%;
}

.modal-top-row {
    display: flex;
    gap: 15px;
    height: 45%;
}

.modal-table-section.compact {
    flex: 1;
    min-width: 0;
}

.modal-table-section.compact .modal-detail-table {
    font-size: 0.7rem;
}

.modal-table-section.compact h4 {
    font-size: 0.8rem;
    margin-bottom: 6px;
}

.compact-table {
    font-size: 0.7rem !important;
}

.compact-table td {
    padding: 2px 0 !important;
}

.compact-table .table-label {
    width: 35% !important;
    font-size: 0.65rem !important;
}

.compact-table .table-value {
    font-size: 0.7rem !important;
}

.modal-bottom-row {
    display: flex;
    gap: 20px;
    height: 25%;
}

.modal-charts-row {
    display: flex;
    gap: 20px;
    height: 30%;
}

.modal-table-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.modal-table-section.full-width {
    width: 100%;
}

.modal-table-section h4 {
    color: #fff;
    margin: 0 0 8px 0;
    font-size: 0.9rem;
    font-weight: bold;
}

.modal-detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
    flex: 1;
}

.modal-detail-table tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-detail-table tr:last-child {
    border-bottom: none;
}

.modal-detail-table td {
    padding: 4px 0;
    color: #fff;
}

.table-label {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8) !important;
    width: 40%;
}

.table-value {
    font-weight: bold;
    color: #fff !important;
}

.chart-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.modal-top-row .chart-section {
    flex: 1.2;
}

.chart-section h4 {
    color: #fff;
    margin: 0 0 8px 0;
    font-size: 0.9rem;
    font-weight: bold;
    text-align: center;
}

.chart-container {
    position: relative;
    height: 100%;
    width: 100%;
    flex: 1;
}

.modal-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.modal-info-section {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 8px;
}

.modal-info-section h4 {
    color: #fff;
    margin-bottom: 15px;
    font-size: 1.1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 8px;
}

.modal-info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.modal-info-label {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

.modal-info-value {
    color: #fff;
    font-weight: bold;
}

.modal-info-value.empty {
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
}

/* 详细弹框布局 */
.modal-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.modal-detail-section {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 10px;
}

.modal-detail-section h4 {
    color: #fff;
    margin-bottom: 15px;
    font-size: 1.1rem;
    text-align: center;
}

.modal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    margin-bottom: 15px;
}

.modal-table th,
.modal-table td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
}

.modal-table th {
    background: rgba(255, 255, 255, 0.1);
    font-weight: bold;
}

.modal-chart-container {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.modal-chart-container h4 {
    color: #fff;
    margin-bottom: 15px;
    font-size: 1.1rem;
    text-align: center;
}

.chart-wrapper {
    position: relative;
    height: 200px;
    margin-bottom: 15px;
}

.scatter-plot {
    height: 150px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    position: relative;
    margin-bottom: 10px;
}

.scatter-plot .axis {
    position: absolute;
    background: rgba(255, 255, 255, 0.3);
}

.scatter-plot .axis.x {
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
}

.scatter-plot .axis.y {
    top: 0;
    bottom: 0;
    left: 0;
    width: 1px;
}

.scatter-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.scatter-dot.parking {
    background: #000;
}

.scatter-dot.defect {
    background: #ff0000;
}

.timeline-chart {
    height: 60px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    position: relative;
    margin-bottom: 10px;
}

.timeline-segment {
    position: absolute;
    height: 100%;
    border-radius: 3px;
}

.timeline-segment.xu-lina {
    background: #ff69b4;
}

.timeline-segment.zhou-shikui {
    background: #ffa500;
}

.modal-footer {
    text-align: right;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.confirm-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 10px 30px;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s ease;
}

.confirm-btn:hover {
    background: #0056b3;
}

/* 响应式设计 */
@media (max-width: 1600px) {
    .machine-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 1400px) {
    .machine-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1100px) {
    .machine-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .machine-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .header-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .status-bar {
        text-align: center;
        flex-direction: row;
        gap: 20px;
    }
    
    .main-title {
        font-size: 1.8rem;
    }
    
    .sub-title {
        font-size: 0.9rem;
    }
}

@media (max-width: 600px) {
    .machine-grid {
        grid-template-columns: 1fr;
    }
    
    .container {
        padding: 0 5px;
    }
    
    .main-title {
        font-size: 1.5rem;
    }
    
    .sub-title {
        font-size: 0.8rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .modal-info-grid {
        grid-template-columns: 1fr;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
} 